package com.zyh.system.supermark1.controller;

import com.zyh.system.supermark1.service.impl.UserServiceImpl;

import java.util.Scanner;

public class UserIndex {
    public static final UserServiceImpl serviceImpl = new UserServiceImpl();
    public static final Scanner INPUT = new Scanner(System.in);

    public void userIndex() {
        while (true) {
            System.out.println("*********************电器商城********************************");
            System.out.println("                    1.用户登录                               ");
            System.out.println("                    2.用户注册                               ");
            System.out.println("                    3.退出系统                               ");
            System.out.println("*********************电器商城********************************");
            System.out.println("请输入菜单：");
            int choice = INPUT.nextInt();
            switch (choice) {
                case 1://1.用户登录
                    serviceImpl.login();
                    break;
                case 2://2.用户注册
                    serviceImpl.register();
                    break;
                default://3.系统退出
                    System.out.println("系统退出");
                    System.exit(0);
            }
        }
    }
}
